<template>
	<div>
		<echarts-box title="最新考勤" style="flex:1;height: calc(100% - 50px);">
			<div slot="echarets" style="height: 100%;position: relative;">
				<!-- <div style="position: absolute;right: 0;top: -30px;">
					<el-link type="primary" :href="'http://datav.qzls-iot.com/#/?id=' + projectID" target="_blank" :underline="false"
					 style="font-size: 16px !important;margin-right: 10px;">大屏展示</el-link>
					 <el-button type="text" @click="openIndicators">八个百分百</el-button>
				</div> -->
				<el-table :data="nowAtt" border style="width: 100%" class="box_homeLeft">
					<el-table-column prop="workerName" label="工人" align="center" show-overflow-tooltip>
					</el-table-column>
					<el-table-column prop="teamName" label="班组" align="center" show-overflow-tooltip>
					</el-table-column>
					<el-table-column prop="direction" label="进出场" width="70" align="center" show-overflow-tooltip>
					</el-table-column>
					<el-table-column prop="date" label="时间" width="160" align="center" show-overflow-tooltip>
					</el-table-column>
				</el-table>
			</div>
		</echarts-box>
	</div>
</template>
<script>
	import {
		post
	} from '../../api/myFunction.js'
	import Cookies from 'js-cookie'
	import echartsBox from './components/echartsBox.vue'
	export default {
		components: {
			echartsBox
		},
		props: {
			att: {
				type: Array
			}
		},
		computed: {
			nowAtt() {
				var newArr = []
				for (var i = 0; i < this.att.length; i++) {
					if (i < 17) {
						newArr.push(this.att[i])
					}
				}
				return newArr
			},

			projectID: function() {
				return Cookies.get('projectID');
			}
		},
		methods: {
			getRowClass() {
				return "ceshi";
			},
			openIndicators: function(row) {
				post(this, 'GET', 'project/standard', {
					id: this.projectID
				}, (res) => {
					window.open(res.data, '_blank');
				}, (err) => {})
			},
		}
	}
</script>

<style lang="stylus" scoped>
	.box_homeLeft>>>th 
		padding 0 !important 
		height 30px 
		line-height 30px 
		background #f3f3f3 
		border none !important 
	.box_homeLeft>>>td 
		padding 0 !important 
		height 30px 
		line-height 30px 
		background #f3f3f3 
		border none !important
</style>
